<template>
	<view class="checkBox" v-if="item.range.length!==0">
			<text class="tit" v-text="item.label" :class="item.required ? 'inputRequired' : ''" v-if="item.label"></text>
			<checkbox-group @change="change">
				<label  v-for="item in item.range" :key="item.value">
					<checkbox :value="item.value"  color="#FFCC33" style="transform:scale(0.7)"/>
					<text v-text="item.name"></text>
				</label>
				
			</checkbox-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		props: {
			item: {
				type: Object
			},
			index: {
				type: Number
			}
		},
		methods: {
            change: function (e) {
               debugger
			   let chooseStr = e.detail.value.join(',')
               this.$emit('checkBoxChange', chooseStr)
            }
		}
	}
</script>

<style  lang="scss" scoped>
.grayBox {
	background: #f0f0f0;
}
.checkBox {
	margin: 0 50upx;
	.tit {
		display: inline-flex;
		font-size: 28upx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #3c68e5;
		margin:10upx 0;
	}
	
}
</style>
